<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<h:panelGrid id="pictureInfoInputPanel"
		rendered="#{pictureModel.current != null}" columns="1"
		style="width:100%">

		<h:panelGrid columns="2" style="width:100%">
			<h:panelGrid columns="2" cellspacing="15px" style="width:100%">
				<h:outputText value="id" />
				<h:outputText value="#{pictureModel.current.id}" />
				<h:outputText value="Choose a picture" />

				<p:commandButton ajax="true"
					update=":choosePictureDialogForm,:headerForm" value="Choose"
					oncomplete="choosePictureDlg.show()"></p:commandButton>

				<h:outputText value="File name" />
				<h:outputText value="#{pictureModel.current.fileName}" />
				<h:outputText value="Path" />
				<h:outputText value="#{pictureModel.current.path}" />

				<h:outputText value="Type" />
				<p:selectOneMenu value="#{pictureModel.current.type}">
					<f:selectItems value="#{pictureModel.availableTypes}" var="type"
						itemValue="#{type}" itemLabel="#{type.label}"></f:selectItems>
				</p:selectOneMenu>
				<h:outputText value="Is home page picture ?"/>
				<p:selectBooleanCheckbox value="#{pictureModel.current.isHomePage}"/>
				<h:outputText value="Uploaded date" />
				<h:outputText value="#{pictureModel.current.uploadedDate}" />
				<h:outputText value="Taken Date" />
				<p:calendar value="#{pictureModel.current.takenDate}" />
				<h:outputText value="Recommendation index" />
				<h:inputText value="#{pictureModel.current.recommendIndex}" />
			</h:panelGrid>
			<h:panelGroup rendered="#{pictureModel.current.isRecycled==false}">
				<p:graphicImage height="240px" width="320px"
					value="#{pictureModel.current.dataStream}"
					rendered="#{pictureModel.current.uploadedFile != null}"></p:graphicImage>

				<h:graphicImage library="images"
					value="../#{pictureModel.current.fullFileName}"
					style="width:320px;height:240px"
					rendered="#{pictureModel.current.uploadedFile == null}"></h:graphicImage>
			</h:panelGroup>
		</h:panelGrid>
		<h:panelGrid columns="2" style="width:100%">
			<h:outputText value="Title" />
			<p:tabView>
				<p:tab title="English">
					<h:panelGrid columns="1" cellspacing="5" style="width:100%">
						<p:inputText value="#{pictureModel.current.title}"
							style="width:100%" />
						<p:inputTextarea value="#{pictureModel.current.description}"
							style="width:100%;height:150px" />
					</h:panelGrid>
				</p:tab>
				<p:tab title="Chinese">
					<h:inputText value="#{pictureModel.current.chineseTitle}"
						style="width:100%" />
					<p:inputTextarea value="#{pictureModel.current.chineseDescription}"
						style="width:100%;height:150px" />
				</p:tab>
				<p:tab title="French">
					<h:inputText value="#{pictureModel.current.frenchTitle}"
						style="width:100%" />
					<p:inputTextarea value="#{pictureModel.current.frenchDescription}"
						style="width:100%;height:150px" />
				</p:tab>
			</p:tabView>
		</h:panelGrid>
	</h:panelGrid>
</ui:composition>
</html>